Make sure to remove tooltip timeout.
authorOlof-Joachim Frahm <olof@macrolet.net>
Sun, 5 Feb 2017 18:08:56 +0000 (19:08 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 8 May 2017 22:05:21 +0000 (18:05 -0400)
Otherwise in GC-ed environments the `g_source_remove` call during
disposal might be called on an already removed source, which results in
unnecessary console output.

https://bugzilla.gnome.org/show_bug.cgi?id=778301

gtk/gtktooltip.c

index ea4bf310b2eae533ecad147a4a3915cc92aa2c02..67fc943845d261cba52adf79288c4fed40ee8887 100644 (file)
@@ -732,6 +732,12 @@ tooltip_browse_mode_expired (gpointer data)
   tooltip->browse_mode_enabled = FALSE;
   tooltip->browse_mode_timeout_id = 0;
 
+  if (tooltip->timeout_id)
+    {
+      g_source_remove (tooltip->timeout_id);
+      tooltip->timeout_id = 0;
+    }
+
   /* destroy tooltip */
   display = gtk_widget_get_display (tooltip->window);
   g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL);
@@ -744,6 +750,12 @@ gtk_tooltip_display_closed (GdkDisplay *display,
                            gboolean    was_error,
                            GtkTooltip *tooltip)
 {
+  if (tooltip->timeout_id)
+    {
+      g_source_remove (tooltip->timeout_id);
+      tooltip->timeout_id = 0;
+    }
+
   g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL);
 }